package cn.itsource.controller;

import cn.itsource.domain.User;
import cn.itsource.feignclient.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayController {

    // 注入feign的客户端
    @Autowired
    private UserFeignClient userFeignClient;

    @GetMapping("/getUserById/{id}")
    public User getUser(@PathVariable("id")Long id){
        System.out.println("=============PayController 执行==================");
        // 调用User服务 获取结果
        return userFeignClient.getUser(id);
    }
}
